package ThreadDemo;

class TaskThread extends Thread {

    public TaskThread() {
    }

    public TaskThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        // 获取正在这些这段代码的这个线程对象
        Thread thread = Thread.currentThread();
        // 获取这个对象的内存地址值
        String memoryAddr = Integer.toHexString(thread.hashCode());

        System.out.println("TaskThread: 【" + thread.getName() + "】的内存地址值是: " + memoryAddr);
    }
}